package com.hllxd.hism.star.basic.service.constant;

/**
 * 支付方式枚举
 *
 * @author liuxiongbo
 * @date 2020/12/21 0:15
 **/
public enum  PaymentWayEnum {
    //付款方式：1-微信付款、2-支付宝付款、3-银联支付、4-现金、5-支票、6-快捷支付、
    //     * 7-余额支付 、8-微信扫码、9-支付宝扫码 10-微信公众号 11-优惠券支付 12-卡支付
    WE_CHAT(1, "微信"),
    ALIY_PAY(2, "支付宝"),
    CHINA_PAY(3, "企业网银"),
    CHEQUE(5, "支票"),
    BALANCE_PAY(7, "账务主体余额"),
    WE_CHAT_SCAN(8, "微信"),
    ALIY_PAY_SCAN(9, "支付宝"),
    WE_CHAT_OFFICIAL_ACCOUTN(10, "微信"),
    BANK_CARD(12, "对公转账")
    ;
    private Integer paymentWayCode;
    private String paymentWayName;

    PaymentWayEnum(Integer paymentWayCode, String paymentWayName) {
        this.paymentWayCode = paymentWayCode;
        this.paymentWayName = paymentWayName;
    }

    public Integer getPaymentWayCode() {
        return paymentWayCode;
    }

    public String getPaymentWayName() {
        return paymentWayName;
    }

    public static PaymentWayEnum getPaymentWayEnumByCode(Integer paymentWayCode) {
        for (PaymentWayEnum value : PaymentWayEnum.values()) {
            if (value.getPaymentWayCode().equals(paymentWayCode)) {
                return value;
            }
        }
        return null;
    }
}
